reduce memory
fix db issue