Add remove class to X button, move click handler