moved button initialization and adding listeners