logic error with passing information