Moved param write/read inside sleep check