refraction bug fixed