write and sync operation implemented