realigned time and fixed onTime