create remove function, but this function work uncorrectly