narrowing warning fixed

added cast to filename.length() to remove warning