fixed a server bug (server still unusable)

fixted a serverbug and formated the soure for readability.