Fixed bug with time gettin