Moved stuff around

just fixing up some error checks