implement replace check
implemented card replacement