custom exception and fix in the static api