changed error 512 to 511