more error handling, now also checking that check_mysql exists