Switched app to use database