improve messenger error handling