add error checks for 500