add more feature to make it easier to use and debug