use debug both on client and server, removed debugs function