Fixing code for beta 5