Fixed crash at the end