fixed issue 6 by Ma