bug fix for detecting option