fix to remove unused variable random