Some authors/teachers consider ions to be spectator ions (and thus omitted) if they would be unchanged electronically on both sides of the equation irrespective of their physical state (eg solid or aqueous) others will require an ion to appear on both sides of the equation if it changes state even though, in other respects, it remains unchanged. You need to reflect on what your teacher or exam board prefer; to see if this might be the source of your error.