some bug fixes and add delay evaluation