recoded the solution for this issue