added the check for regualr files