removed unneccessary setAttribute(method, post) calls as per feedback provided by @froschdesign