removed c++11 features
removed unnecessary check
fixed crash on reading data