minor bugfix with $WAIT_GRACE_MINUTES variable