fix bug with 500 err