added logging for debugging