fixed variable uninitialized error