read-write function validation added