Moved the unless clause so it is more efficient