Use events insetad of callbacks
Fix if statements