added exception for unexpected behavior