fix calling value() twice