fix scroll position bug, move color button selector function out of loop