fixed timing bugs