Added filename checks