added foundation
fixed database issue