fixed db connection using OOP way