remove debugging and fix issue with refresh