more changes to main and server