Fixing code loading too early