better error handling
resolved merge conflicts