Added loading state, fixed variable name