check if initvalue is undefined so 0 could be set