Modified create_event function to match with received data