added funcationality for pre-selected button