now working with test app but still some debug work to do