some initialization logic that was forgotten + variable type fix