cashing messages and handeling errors