add button logic corrected