added test and fixed field bug