added sql and event controller/view