Added functions to write and delete from registry