added console.log to check function