documnet rready function