better onclick management