Made some changes for code to work on production server