Return errors when bad things happen
remove logs from functions