Works now after refactor