function for generating button for each port