improved code

- fixded Luhn algorithm
- fixded error message handling