Added a possibility to use custom redirect