Added check for filename length