Changed code for buttons instead of Navigation controller.