Disable set button when it's zero and fix the ArrayIndexOutOfBoundException