remove call to close
add val to debug message