Fixed nullpointer bug, added constructor to controllerimpl.