add checking for sql errors

queries need to be repeated if MyCursor().execute() returns false. That has not been done.