added some useful if statements

Stops the code from running if it is already complete!