Fix controller mimetype function