fixed exit bug by using a unclean method
started with fixing deltatime bug