fix builtin function bugs