Fixed crash issues