Fixed a bug with handlers