fixed crashing problem