updated code to return button