fixing function syntax