handle some exceptions better, more debugging