added loop and camera check