added IF condition to avoid NPE when and if an empty Intent is resent at random