fixed some bugs and added a messaging system