added update function and added osx suppurt