Forgot to close function at line 4005