using custom event instead of click