fixed bug with delay