updated with more debug