Added a check to see if post array was empty