made the if options.shim return part of the ending return block