fixed styles, fixed onBeforeComplete event
reformated