fixed null pointer errors
added energy checks on some actions