added write only logic