added logging for debug