jslint suggestions and removed if check for dialog