readded some old code for backwards compatibility