Unwanted data stored in SD card

likely that your code has a bug... But we don't see the code, so can't help..

➜ do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).