Fixed the energy bug