modified to check post data.