Adding a numer of error checks in the rake task