Added automatic upgrade script to index controller (yep I know that sucks)