working but with warnings