added more exception funcionality