made proper error messaging