made some changes to accept different requests