Use array to store callbacks rather than variable