Try to fix the exception of Frame.energy()