Added security checks to properly output information