Fixed bug in request handler