PR for code review

I've put printstacktrace po incase of exception it can be detected easily.