Adding in validation of diagram