Fix bug: Check for file extension