finalized changes for bug #170