bug fix for #1045

Signed-off-by: Aayush Anand <aayushism12@gmail.com>