added console logs for debugging