fix variable is nil