Fix bug with delay