WIP get delay time, added error message, and bug fix