In 5.0.0 you are not using the method introduced in 5.1 that may have some requirements your code doesn't satisfy. Yes, debugging is an obvious step to make.