change exit to return from native