replaced abort with terminate