changes to controller so it actually works this time