Function checkRequest