patch for feature request #1518

Signed-off-by: A V Minhaz <minhazav@gmail.com>