add checking source state function