fixing issues with register script