fix type begin -> before