try adding checks for correct state to source change