update game loop and create exception class