cleanup, and db fix