trying to make it catch undefined