fixed condition in setTimeFrmae