timing and bug fix