it works,  but jshint complains about the last line