using message and error instead of prints