changes based on @luolong comments