made if statement more clear, fixed spotted bug in load from array