On factoriality of threefolds with isolated singularities