Trying to fix the freezing issue