fixed major bug caused by blindly heeding JSLint and not thinking.