first check if a extension exists before comparing it