fix for NPE when service starts while activity is hidden