Added more verifications while setting icon