fixed operation of DBHandler (Write)