Changed to use  and built an inner controler