mysql working, put to separate file in controller