add sqlite write method