adding controller code