added a check for undefined options while extending