timing fixes,small bugs fixed