added check for types of requests