fix bug

'after' function could be empty