Logical fixes
1. Added (D/L) check
2. Added null check for out info