fixed one bug relevant to ticket #27