fixing function clause