Scan interface only accept int64, float64, bool, []byte, string,
time.Time or nil. When do scan, it's better to check whether the type
support valuer interface and do convert.
The map is modified in different places in the code which results in race conditions
on execution.
This commit locks the map with read-write lock when it is modified