Changed reinterpret_cast to static_cast