added cmdargs to allow uses form terminal also added feedback to failure