bug fix on(events)

The .on( ) events was not working properly because of it's async status.