bug fixed for buy energy