Fix Issues #1 #2 #3

changes to fix the issues #1, #2 and #3