Moved debug flag so it works for both POST&GET methods