bug fixed / error handling