implemented all message functions