Few changes to the original server code to make it work