Added some more error checking to release