Fixed code for Beta4