fixed execution of @afterClass and @beforeClass hooks