More error checks