Fixed bug due to the use of e.target rather than e.currentTarget