clean up buggy variable to be outside of controller