Small changes to make the code work on server