Moved the var declaration

Made it so that it is only declared in the event that the POST isn't empty. Should work that way. Also, some formatting.