get rid of undef comparison warnings
start working on error messages