Added SD functionality and fixed issue with a btn