small fix and optimization