updated for more logging