catch error for invalid amount