added console logs for debug