connects to db but has error