Fixed the forking problem in the server for handling the messages