tailLayer is invoked only once