Updated to work with the new handler API