applied pull request 21 of stgeneral repo with commit ID 51f6ee3