worked on server and client