add a simple check on newarray api