fixed bugs and time issues