updated server side code for debugging.