Added a condition to check empty values