prepare for database