and when i add the file path to terminal after chmod a+x, it says its an invalid file mode
you are wrong, it is not chmod a+x but chmod +x <filename>
im still getting the same problem using chmod +x