added some controller tests and some logic to avoid double instantiation