fixed pattern callback bug