add spec for db connection
fix file type bug