moving some error checks back to their origional spot