Added code to keep server/client consistent

fixes #12