fixing start script
large amount of things mostly to do with access control