fixed several errors after testing on server