Performance improved
Security check added