moved one err_msg to fail_msg like it should of been all along and added the checking of $ROUTINES to equal true or false