added branches for proper validation