refactored jquery .attr('value') to .val() ready for future jquery update