fixing function check