added code for server