replace when package rx handler to a function