fixed logic error..