updated code but fails