fixing function common bug