error handling, using session data on server and nice log on the client side