fixed error in logic (shouldn't try to execute if POST is empty)