added empty file check