An improved method for calculation of elastic constants of metallic glasses