fixed indentation and add extglob