added database inserts and it now compiles