Add some validations to avoid notices detected on server 11.130