Fixed a bug in the conditional rendering