adding dynamic generation of time code to the controller