move entry point, add sanitycheck