made changes to code make JSHint happy