add read_resource callback