Changed rewrite handler

Signed-off-by: Alif Wahid <alif.wahid@gmail.com>