add debug message and fix sphere intersection & refraction