add null checking and remove unnecessary killProce