bug in function removed