fir for issue#308, added new test cases