fixed logic error which broke the build