Prevent deadlocks

by checking the status of components before trying to change them.