added debugging to getFields