adding events to database is working, still needs further improvements