use strict, and fixed bugs