added 'else if' to make sure truthy on .end's first call
added a simple test to make sure end callbacks will actually be called
no semicolons