bug fix for #15 and #26

new bug generated due o #15 i.e. #26 , also fixed that......Team Members: Karan Khare & Ramya Shenoy