refactored for jshint
refactored out use of the after() function