safety checks
stack management initial support #21