bug fixes for issues 36,37,38