added prep controller code