fixed extension()

$model was missing in getFileExtension call