patter matching issue fixed