Fixed wrong error, added better callback