working on errors and resurce