fix bug in error handling in subscribe