adding time and fixes for scheduler