add select read or write type condition