Fixed closure issue and now get the fields from the server