Adding check for completed to prevent locking indefinitely