added a check for updates and fixed some bugs