nit: as long as you are in here editing, can you add the curlies around the body of the if?  jshint will require these eventually anyway