fixed #4
cleaned up DB stuff