rewrite getController funtion