Fix copy-paste logic error