add mail and message function
solve all the warnings