Add check if it was a post request

Prevent from executing check if there was no data submitted