updated code for postReq handling