Made changes in server to run in infinite loop