Fix small bug, referencing var before defined