Fixed a bug in requests handler