checking state before polling