fixed a bug due to multiple usage of time interval