added resetting arrays before refresh