fix delete step and echo the failed return code to the log