fixing function vars because I'm stupid