trying to finish template database saving